function HappyLightBox() {
	
	this.createLightOverlay = function(){
		var lightOverlay = document.createElement('div');
		var closeLightBoxButton = document.createElement('div');
		
		lightOverlay.setAttribute('id', 'fullhappy_light_box_light');
		// lightOverlayDiv.setAttribute('class','fullhappy_light_box_light');
		lightOverlay.setAttribute('style', 'position: absolute;'
				+ 'box-shadow:0 0 6px #000000;' + 'width: 400px;'
				+ 'height: 200px;' + 'padding: 16px;'
				+ 'background-color: white;' + 'z-index: 1002;'
				+ 'border-radius: 4px;');

		closeLightBoxButton.setAttribute('id',
				'fulhappy_light_box_close_box_button');
		// closeLightBoxButton.setAttribute('class',
		// 'fulhappy_light_box_close_box_button');
		closeLightBoxButton.setAttribute('style', 'background-color: #0C0C0C;'
				+ 'border: 2px solid #FFFFFF;' + 'border-radius: 10px;'
				+ 'box-shadow: 0 0 6px #000000;' + 'color: #FFFFFF;'
				+ 'cursor: pointer;' + 'font-size: 11px;' + 'height: 16px;'
				+ 'position: absolute;' + 'right: -8px;'
				+ 'text-align: center;' + 'top: -8px;' + 'width: 16px;');

		closeLightBoxButton.appendChild(document.createTextNode('x'));
		closeLightBoxButton.addEventListener('click', this.close, true);
		lightOverlay.appendChild(closeLightBoxButton);
		return lightOverlay;
	};
	
	this.createFadeOverlay = function(){
		var fadeOverlay = document.createElement('div');		
		fadeOverlay.setAttribute('id', 'fullhappy_light_box_fade');
		/* fadeOverlayDiv.setAttribute('class','fullhappy_light_box_fade'); */
		fadeOverlay.setAttribute('style', 'position: fixed;' + 'top: 0%;'
				+ 'left: 0%;' + 'width: 100%;' + 'height: 100%;'
				+ 'background-color: #aaa;' + 'z-index: 1001;'
				+ '-moz-opacity: 0.3;' + 'opacity: .30;'
				+ 'filter: alpha(opacity = 30);');
		return fadeOverlay;
	};

	this.innerClose = function() {
		var lightOverlay = window.parent.document.getElementById('fullhappy_light_box_light');
		var fadeOverlay = window.parent.document.getElementById('fullhappy_light_box_fade');
		if (lightOverlay != null && fadeOverlay != null) {
			lightOverlay.parentNode.removeChild(lightOverlay);
			fadeOverlay.parentNode.removeChild(fadeOverlay);
		}
		return false;
	};
	
	this.close = function() {
		var lightOverlay = document.getElementById('fullhappy_light_box_light');
		var fadeOverlay = document.getElementById('fullhappy_light_box_fade');
		if (lightOverlay != null && fadeOverlay != null) {
			lightOverlay.parentNode.removeChild(lightOverlay);
			fadeOverlay.parentNode.removeChild(fadeOverlay);
		}
		return false;
	};
	this.openContentIframe = function(src, width, height) {
		var iframe = document.createElement('iframe');
		iframe.style.width = width + 'px';
		iframe.style.height = height + 'px';
		iframe.style.border = 'none';
		iframe.src = src;
		this.openContentChildNode(iframe);
	};
	
	//	this.prompt = funtion(message, okCallback, cancelCallback){
	this.prompt = function(message, defaultValue, okCallback){
		/*
		 	<form>
			<input id="new_category_name" type="text" placeholder="eeeee" style="width: 150px;">
			<input type="button" value="save">
			</form>
		 */
		
		var _form = document.createElement('form');
		
		var _header = document.createElement('span'); 
		var _inputText = document.createElement('input');
		var _inputButton = document.createElement('input');
		
		_form.setAttribute('style','width: 400px; height:120px; margin: 0 ;text-align: center;');
		
		_header.setAttribute('style','color: #333333;');
		
		_inputText.setAttribute('type','text');
		_inputText.setAttribute('value', defaultValue);
		_inputText.setAttribute('style', 'border: 1px solid #CCCCCC; border-radius: 4px 4px 4px 4px; padding: 10px; margin-bottom: 15px; margin-top: 15px; width: 100%;');
		
		_inputButton.setAttribute('type','button');
		_inputButton.setAttribute('value','save');
		_inputButton.setAttribute('style','background-image: -moz-linear-gradient(center top , rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));'
									+'border-radius: 4px 4px 4px 4px;'
									+'box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.5) inset;'
									+'color: #FFFFFF;'
									+'font-weight: bold;'
									+'padding: 6px 15px;'
									+'text-decoration: none;'
									+'text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);'
									+'background-color: #5CB811;'
									+'border: 1px solid #45890D;');
		
		_inputButton.addEventListener('click', function(){okCallback(_inputText.value);} , true);
		
		_header.appendChild(document.createTextNode(message));
		
		_form.appendChild(_header);

		_form.appendChild(_inputText);
		_form.appendChild(document.createElement('br'));
		_form.appendChild(_inputButton);
		
		this.openContentChildNode(_form);
	};
	
	this.openContentChildNode = function(childNode) {
		var fadeOverlay = this.createFadeOverlay();
		var lightOverlay = this.createLightOverlay();
		var closeLightBoxButton = document.createElement('div');

		closeLightBoxButton.setAttribute('id',
				'fulhappy_light_box_close_box_button');
		// closeLightBoxButton.setAttribute('class',
		// 'fulhappy_light_box_close_box_button');
		closeLightBoxButton.setAttribute('style', 'background-color: #0C0C0C;'
				+ 'border: 2px solid #FFFFFF;' + 'border-radius: 10px;'
				+ 'box-shadow: 0 0 6px #000000;' + 'color: #FFFFFF;'
				+ 'cursor: pointer;' + 'font-size: 11px;' + 'height: 16px;'
				+ 'position: absolute;' + 'right: -8px;'
				+ 'text-align: center;' + 'top: -8px;' + 'width: 16px;');

		closeLightBoxButton.appendChild(document.createTextNode('x'));
		closeLightBoxButton.addEventListener('click', this.close, true);
		var body = document.getElementsByTagName('body')[0];
		body.appendChild(fadeOverlay);

		lightOverlay.appendChild(closeLightBoxButton);
		lightOverlay.appendChild(childNode);
		body.appendChild(lightOverlay);

		var maxHeight = fadeOverlay.offsetHeight;
		var maxWidth = fadeOverlay.offsetWidth;
		lightOverlay.style.height = childNode.clientHeight + 'px';
		lightOverlay.style.width = childNode.clientWidth + 'px';
		// light box display in center -> lightOverlayTop = (maxHeight -
		// lightOverlay.offsetHeight)/2
		// or light box display in center top -> lightOverlayTop = 10;
		var lightOverlayTop = (maxHeight > (lightOverlay.offsetHeight + 10)) ? (maxHeight - lightOverlay.offsetHeight) / 2
				: 10;
		var lightOverlayLeft = (maxWidth > (lightOverlay.offsetWidth + 10)) ? (maxWidth - lightOverlay.offsetWidth) / 2
				: 10;
		lightOverlay.style.top = lightOverlayTop + 'px';
		lightOverlay.style.left = lightOverlayLeft + 'px';

	};
	
	
}